﻿using System;
using System.Collections.Generic;

namespace SharpObjects.SearchEngine.Common.Search
{
    [Serializable]
    public class QueryResultItem : IQueryResultItem
    {
        public int DocumentId { get; set; }
        public string Uri { get; set; }
        public DateTime DateIndexed { get; set; }
        public DateTime DateModified { get; set; }
        public double Score { get; set; }
        public Dictionary<string, IQueryResultItemField> Fields { get; set; }
        public string Context { get; set; }

        public QueryResultItem()
        {
            this.Fields = new Dictionary<string, IQueryResultItemField>();
        }

        public override string ToString()
        {
            return string.Format("[{0,4:0.00}] {1}", this.Score, this.Uri);
        }
    }
}
